package cn.walls1717.wallsmall.product.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Redisson配置类
 *
 * @author walls1717
 * @since 2022/11/04 21:33
 **/
@Configuration
public class RedissonConfig {

    /**
     * Redisson客户端
     *
     * @return RedissonClient
     */
    @Bean(destroyMethod = "shutdown")
    public RedissonClient redisson() {
        Config config = new Config();
        config.useSingleServer().setAddress("redis://43.143.220.43:6379").setPassword("chengjie");
        return Redisson.create(config);
    }
}
